﻿using B.S.Filtration.Domain;
using B.S.Filtration.ErrorCode;
using B.S.Filtration.Read.Api.Application.Command.ProcessMonitoringCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Filtration.Read.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProcessMonitorinController : ControllerBase
    {
        private readonly IMediator mediator;

        public ProcessMonitorinController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 过程监控显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<APIPaging<ProcessMonitoring>>>GetProcessMonitoringle([FromQuery]GetProcessMonitoringCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 过程监控反填
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<APIResult<List<ProcessMonitoring>>> FTProcessMonitoring([FromQuery] FTProcessMonitoringCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
